home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / pnn.ind < prev    next >
File List  |  1993-08-23  |  4KB  |  233 lines

  1. inst4.1
  2. !****************************************************************
  3. !*                                *
  4. !* Probabilistic Neural Network Builder                *
  5. !*                                *
  6. !****************************************************************
  7. !
  8. ?&In    1
  9. >bge    ChkProto
  10. @Err    "Probabilistic Neural Network MUST have at least one input PE"
  11. :ChkProto
  12. ?&Prt    1
  13. >bge    CheckOut
  14. @Err    "Probabilistic Neural Network MUST have at least one pattern unit"
  15. :CheckOut
  16. ?&Out    2
  17. >bge    OutOK
  18. @Err    "Probabilistic Neural Network MUST have at least two output PEs"
  19. :OutOK
  20.  
  21. !    *** Load the Control Strategy ***
  22. @LdCS    "pnn"
  23.  
  24. =netn "Untitled"
  25. =DLnF    0            !learn  re-display off
  26. =DRcF    0            !recall re-display off
  27.  
  28. !    *** Build the Input Layer ***
  29.  
  30. @LLdf                !load default layer to menu area
  31. =LDln    "In"            !layer name
  32. =Lpes    &In            !copy # of input PEs from menu
  33. =x    100            !place to put layer on screen
  34. =y     40
  35. @LDfW                !Default # weight fields
  36. @LAdd                !add the input layer
  37.  
  38. !    *** Build a Projection Layer if projection summation  ***
  39.  
  40. ?RBFS    2            !Projection summation?
  41. >bne    ProjL1            !No
  42.  
  43. #Incl   "proj_lyr.iif"
  44. =n6    LayN            !Previous Layer
  45.  
  46. :ProjL1
  47. !
  48. ! Build Pattern layer
  49. !
  50. @LLdf                !start with default layer again
  51. =LDln    "Pattern"        !layer name
  52. =Lpes    &Prt            !Number of PEs
  53. ! Summation function
  54. ?RBFS    1            !City-Block?
  55. >bne    Sum1
  56. =Lsum    "City-Block"
  57. >br    SumEnd
  58. :Sum1
  59. ?RBFS    2            !Projection?
  60. >bne    Sum2
  61. =Lsum    "Sum"            !standard summation
  62. >br    SumEnd
  63. :Sum2                !Default
  64. =Lsum    "Euclidean"
  65. :SumEnd
  66.  
  67. =Ltrn    "Linear"
  68. =Llrn    "K-Means"
  69. =Lerf    "standard"
  70. =Ltrn    "PNN"
  71. =Lcmp    "Select"
  72. ! Set up schedule
  73. @NLRS    "PNN"
  74. ! Column A
  75. =lcta    99999
  76. =ArrX    1
  77. =lcft    "No Recode"
  78. =lcfa    0.0
  79. ! Radius of Influence
  80. =ArrX    2
  81. =lcft    "Cluster Radius"
  82. =lcfa    RInf
  83. ! Sigma Scale
  84. =ArrX    5
  85. =rcfa    SgSc
  86. =rcft    "Sigma Scale"
  87. ! Sigma Exponent
  88. =ArrX    6
  89. =rcfa    SgEx
  90. =rcft    "Sigma Exponent"
  91. @SLRS
  92. =ArrX    0
  93. =Llrs    "PNN"
  94.  
  95. =LInH    0.1
  96. =LInL    -0.1
  97. +y    60            !up higher on display
  98. @LDfW                !Default # weight fields
  99. @LAdd
  100.  
  101. ! Connect input layer to pattern layer
  102.  
  103. =cnwt    1.0
  104. =cnty    WVar            !Variable
  105. =cnsc    WRel            !Relative
  106. =SPEl    LayN            !destination layer
  107. @SlPE                !select as destination
  108. =NPEl    n6            !source layer
  109. @NrPE                !select as source
  110. @LCFl                !full connections
  111.  
  112. =n6    LayN            !previous layer
  113.  
  114. ! Now build summation layer
  115. @LLdf                !start with default layer again
  116. =LDln    "Summation"        !layer name
  117. =Lpes    &Out            !Number of PEs
  118. =Lsum    "Sum"
  119. =Ltrn    "Linear"
  120. =Lcmp    "Direct"
  121. =Llrn    "PNN"
  122. =Lerf    "standard"
  123. =LInH    1.0
  124. =LInL    1.0
  125. +y    60            !up higher on display
  126. @LDfW                !Default # weight fields
  127. @LAdd
  128.  
  129. ! Now do connections.
  130. =cnwt    1.0
  131. =cnty    WVar            !Variable
  132. =cnsc    WRel            !Relative
  133. =SPEl    LayN            !summation layer
  134. =SPEn    0
  135. =NPEl    n6            !prototype layer
  136. =NPEn    0
  137. :RndRbnLp
  138. @SlPE                !select next PE in output layer
  139. @NrPE                !select next PE in pattern layer
  140. @PCon                !connect two PEs together
  141. +SPEn    1            !next PE in output layer
  142. ?SPEn    &Out            !past the end?
  143. >blt    OutPEOK
  144. =SPEn    0            !back to start of output layer
  145. :OutPEOK
  146. +NPEn    1            !next PE in the competitive layer
  147. ?NPEn    &Prt            !done with layer?
  148. >blt    RndRbnLp        !no, keep going
  149.  
  150. =n6    LayN            !previous layer
  151.  
  152. ! Output layer
  153. @LLdf                !start with default layer again
  154. =LDln    "Out"            !layer name
  155. =Lpes    &Out            !Number of PEs
  156. =Lsum    "Sum"
  157. =Ltrn    "Linear"
  158. ?PNom    1            !Probabilistic Output?
  159. >bne    NotPbOut
  160. =Lcmp    "Direct"
  161. >br    OutMdEnd
  162. :NotPbOut
  163. ?PNom    2            !Normalized Output?
  164. >bne    NotNmOut
  165. =Lcmp    "Normalize"
  166. >br    OutMdEnd
  167. :NotNmOut
  168. =Lcmp    "One-Active-Highest"
  169. :OutMdEnd
  170. =Lerf    "standard"
  171. =LInH    1.0
  172. =LInL    1.0
  173. +y    50
  174. @LAdd
  175.  
  176. ! Fixed corresponding connections
  177. =cnwt    1.0
  178. =cnty    WFix            !Variable
  179. =cnsc    WRel            !Relative
  180. =SPEl    LayN
  181. =SPEn    0
  182. @SlPE
  183. =NPEl    n6
  184. =NPEn    0
  185. @NrPE
  186. @LCCr
  187.  
  188. =LnPr    0            !no pruning
  189.  
  190. !    *** Select Control Strategy & L/R Schedule ***
  191.  
  192. @LLsl                !load super layer
  193.  
  194. !
  195. ! I/O parameters:
  196. !
  197. =Llnn    "train"            !name of learn input
  198. =Lrcn    "test"            !name of recall output
  199. #Incl    "stdioset.iif"        !standard I/O settings
  200. =Lax1    Epch            !set epoch from dialog
  201. ! Target ranges for MinMax tables
  202. =Lscl    -1.0            !input  low-value
  203. =Loff    1.0            !input  high-value
  204. =Llow    0.0            !output low-value
  205. =Lhgh    1.0            !output high-value
  206. !
  207. =Lctl    "pnn"
  208. =GrLF    "pnn"            !Instrument List file
  209. !
  210. =Llio    1            !Ascii, sequential
  211. @SVsl                !save it back
  212. !
  213. ! Miscellaneous globals
  214. =Grph     1            !Activate instrument list
  215. =jogl    -.1            !lower limit for jog
  216. =jogh    +.1            !upper limit for jog
  217. =seed    257            !starting seed number
  218. @seed                !set the seed
  219. !
  220.  
  221. ! Recall/Test modes
  222. =RnTm    1
  223. =RnRm    1
  224. !set to learn one pass/all
  225. =RnLm    1
  226. !
  227. !
  228. ! Initialize the network
  229. !
  230. @Nini
  231. @EOF
  232.  
  233.